#ifndef XMLPARSER_H
# define XMLPARSER_H

#include <string>
#include <map>

#include "Item.h"
#include "channel.h"
#include "ConsumerParser.h"


class		XMLParser
{
public:
  typedef	bool	(XMLParser::*ContentFunc)(bool isCreated, Item *it);
 XMLParser();
  void		parseFile(const std::string&);
  std::string	getTagName();
  bool	channelTag(bool isCreated, Item *it);
  bool	titleTag(bool isCreated, Item *it);
  bool	descrTag(bool isCreated, Item *it);
  bool	linkTag(bool isCreated, Item *it);
  bool	itemTag(bool isCreated, Item *it);

private:
  std::map<std::string, ContentFunc>		_ptr;
  std::string		_feed;
  channel		_feedContent;
  ConsumerParser	*parser;
  bool			isChan;
  bool			isItem;
};

#endif // !XMLPARSER_H
